package com.neusoft.neuiotms.dcam.workflow.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_workorder_baofei_kj")
@org.hibernate.annotations.Table(appliesTo = "neuiot_workorder_baofei_kj", comment = "科技公司报废表")
public class BaofeiKJ extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    @Length(max = 1000, message = "工单号不能超过{max}位")
    @Column(length = 1000)
    @Comment("varchar(200) COMMENT '工单号'")
    private String workOrderNum;

    @Length(max = 225, message = "任务Id不能超过{max}位")
    @Column(length = 225)
    @Comment("varchar(225) COMMENT '任务Id'")
    private String taskId;

    @Length(max = 2000, message = "备注不能超过{max}位")
    @Column(length = 2000)
    @Comment("varchar(2000) COMMENT '备注'")
    private String remark;

    @Length(max = 225, message = "标题不能超过{max}位")
    @Column(length = 225)
    @Comment("varchar(225) COMMENT '任务Id'")
    private String title;

    @Column(nullable = true)
    private Boolean comprehensive;

    @Length(max = 1000, message = "报废原因不能超过{max}位")
    @Column(length = 1000)
    @Comment("varchar(200) COMMENT '报废原因'")
    private String reason;

    /** 报废日期 */
    @Column(nullable = true)
    private Date disposeDate;

    @OneToMany(mappedBy = "main", cascade = CascadeType.ALL)
    @LazyCollection(LazyCollectionOption.FALSE)
    private List<BaofeiItemKJ> details = new ArrayList<>();

    @Column(length = 225, nullable = false)
    @Comment("varchar(225) COMMENT '创建人'")
    private String createUser;

    @Column(length = 225, nullable = false)
    @Comment("varchar(225) COMMENT '创建人姓名'")
    private String createUserName;

}
